<?php


namespace app\api\controller;



use app\api\services\TestService;
use think\Exception;

class Test extends Base
{
    public function testData()
    {
        try{
//            return 'Test/testData';
            $ret['code'] = 0;
            $ret['msg'] = '获取成功!';
            $ret['data'] = [];
            $ret['count'] = 1;

            $testService = new TestService();
            $id = input('id');// 部门id
            $res = $testService->userReturnMoneyList($id);
            if($res){
                $ret['data'] = $res;
            }

            return json($ret);
        }catch (Exception $e){
            return $this->returnResult(500 , $e->getTrace());
        }

    }

    public function testDataSum()
    {
        try{
//            return 'Test/testData';
            $ret['code'] = 0;
            $ret['msg'] = '获取成功!';
            $ret['data'] = [];
            $ret['count'] = 1;

            $testService = new TestService();
            $id = input('id');// 部门id
            $res = $testService->departReturnSum($id);
            if($res){
                $ret['data'] = $res;
            }

            return json($ret);
        }catch (Exception $e){
            return $this->returnResult(500 , $e->getTrace());
        }

    }

    public function testDepart()
    {
        try{
//            return 'Test/testData';
            $ret['code'] = 0;
            $ret['msg'] = '获取成功!';
            $ret['data'] = [];
            $ret['count'] = 1;

            $testService = new TestService();
            $res = $testService->departList();
            if($res){
                $ret['data'] = $res;
            }

            return json($ret);
        }catch (Exception $e){
            return $this->returnResult(500 , $e->getTrace());
        }
    }
}